<?php
	function stripSpeechMarks( $text ) {
		return replaceSpeechMarks( $text );	
	}
	function replaceSpeechMarks( $text ) {
		// First, replace UTF-8 characters.
		$text1 = str_replace(
		array("\xe2\x80\x98", "\xe2\x80\x99", "\xe2\x80\x9c", "\xe2\x80\x9d", "\xe2\x80\x93", "\xe2\x80\x94", "\xe2\x80\xa6"),
		array("3", "4", '1', '2', '-', '--', '...'),
		$text);
		// Next, replace their Windows-1252 equivalents.
		$text2 = str_replace(
		array(chr(163), chr(34), chr(145), chr(146), chr(147), chr(148), chr(150), chr(151), chr(133)),
		array('&pound;', "'", "'", '&ldquo;', '&rdquo;', '-', '--', '...'),$text);
		
		$text = str_replace(
			array(chr(233), chr(163), chr(34), chr(145), chr(146), chr(147), chr(148)),
			array('&eacute;', '&pound;', "&quot;", "&quot;", "&quot;", "&quot;", "&quot;"),
			$text
		);
		
		return $text;
	}
?>